home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cpptutor.arc / PROTYPE2.CPP < prev    next >
Text File  |  1991-04-28  |  778b  |  37 lines

  1.                                       // Chapter 4 - Program 2
  2. #include "iostream.h"
  3.  
  4. inline void do_stuff(int, float, char);
  5.  
  6. main()
  7. {
  8. int arm = 2;
  9. float foot = 1000.0;
  10. char lookers = 65;
  11.  
  12.    do_stuff(3, 12.0, 67);
  13.    do_stuff(arm, foot, lookers);
  14. }
  15.  
  16. inline void do_stuff(int wings,    //Number of wings
  17.                      float feet,   //Number of feet
  18.                      char eyes)    //Number of eyes
  19. {
  20.    cout << "There are " << wings << " wings." << "\n";
  21.    cout << "There are " << feet << " feet." << "\n";
  22.    cout << "There are " << eyes << " eyes." << "\n\n";
  23. }
  24.  
  25.  
  26.  
  27.  
  28. // Result of execution
  29. //
  30. // There are 3 wings.
  31. // There are 12 feet.
  32. // There are C eyes.
  33. //
  34. // There are 2 wings.
  35. // There are 1000 feet.
  36. // There are A eyes.
  37.